package com.supermacket.model;

import java.util.HashMap;
import java.util.Scanner;

public class PeopleCtrl {

    HashMap map = new HashMap();

    public void init() {

        map = new HashMap();
        People root = new People(0001, "Xonline", "1234", 1);
        People user = new People(1001, "user1", "1234", 2);
        People guest = new People(2001, "guest1", "0000", 3);

        map.put(root.getPid(), root);
        map.put(user.getPid(), user);
        map.put(guest.getPid(), guest);

    }

    public boolean login() {

        Scanner sc = new Scanner(System.in);
        int i = 3;

        System.out.println("=============");
        System.out.println("请输入用户ID：");
        if (map.containsKey(sc.nextInt())) {
            System.out.println("请输入密码：");
            if (i > 0){
                People p = ()
            }
        }else{
            System.out.println("没有此ID，是否创建用户？");
            return false;
    }




    }

}
